DayOfWeekType

Represents the days of the week using a bitmask pattern.

Each day of the week is assigned a unique bit value (powers of 2), allowing combinations of days to be represented as a single long value. This is useful for configurations where multiple days can be selected, such as scheduling content playback or setting operational hours.

The getDaysOfWeek method can be used to convert a combined bitmask value back into an EnumSet of DayOfWeekType enums. To create a bitmask from a set of enums, you would typically iterate over the desired DayOfWeekType instances and bitwise OR their getValue results.

Example of creating a bitmask for Monday and Wednesday:


long mondayAndWednesday = DayOfWeekType.MONDAY.getValue() | DayOfWeekType.WEDNESDAY.getValue();
EnumSet<DayOfWeekType> days = DayOfWeekType.getDaysOfWeek(mondayAndWednesday);
// days will contain MONDAY and WEDNESDAY

See also

Entries

Link copied to clipboard

Sunday (bit value 1, 20).

Link copied to clipboard

Monday (bit value 2, 21).

Link copied to clipboard

Tuesday (bit value 4, 22).

Link copied to clipboard

Wednesday (bit value 8, 23).

Link copied to clipboard

Thursday (bit value 16, 24).

Link copied to clipboard

Friday (bit value 32, 25).

Link copied to clipboard

Saturday (bit value 64, 26).

Properties

Link copied to clipboard
val value: Long
The unique bit flag representing this day of the week.

Functions

Link copied to clipboard
Translates a numeric bitmask value into an EnumSet of selected DayOfWeekType enums.
Link copied to clipboard
open fun valueOf(name: String): DayOfWeekType

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.